xend: Fix check for request to detach non-existent device
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 29 May 2009 08:32:40 +0000 (09:32 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 29 May 2009 08:32:40 +0000 (09:32 +0100)
commit9995f10739d25253a79c9c4aa9481ed5cba91300
tree3987dd06f917e1e87c860f2b84122c044400bca9
parent9c0aebdd02e7624d9d5edfea320d8854f67b95b2
xend: Fix check for request to detach non-existent device

This fixes the check for a request to detatch a non-existent device
in pci_device_configure. The previous check was bogus because the
format of AUTO_PHP_SLOT_STR is not the same as that of x['vslot'].

However, it works in a slightly non-obvious way, checking that vslot
hasn't been altered from its initial value AUTO_PHP_SLOT_STR. To
make this shceme a little clearer, use an empty string as the inital
value.

Formting issues asside, neither AUTO_PHP_SLOT_STR nor the empty
string are valid values for x['vslot']. In the event
of invalid data (indicating a bug), it should be caught by
self.hvm_destroyPCIDevice.

Signed-off-by: Simon Horman <horms@verge.net.au>
tools/python/xen/xend/XendDomainInfo.py